﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master"Inherits="System.Web.Mvc.ViewPage<TemplateWeb.Models.ViewModels.GroupViewModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	SelectThongTinCongTy
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent1" runat="server">
	<span class="AdminTitle" style="color:#cc0000;">Thông tin liên hệ</span>
	(<a href="<%= Url.Action("Index", "Home") %>" class="AdminPageText">
	<%= WebConfiguration.SiteName  %>
	</a>|
    <a href="<%= Url.Action("LogOff", "Account")%>" class="AdminPageText">
	    Thoát
	</a>)
	<br />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent2" runat="server">
	<script type="text/javascript">
		<% if (Model.ThongTinCongTyModel.InfoText != null && Model.ThongTinCongTyModel.InfoText != ""){ %>
			alert('<%= Model.ThongTinCongTyModel.InfoText %>');
		<% } %>
	</script>
     <script type="text/javascript">
         function ValidateThongTinCongTy() {
             var emaillienhe = document.getElementsByName("ThongTinCongTy_EmailLienHe").item(0);
             if (emaillienhe.value == "") {
                 alert("Please input EmailLienHe");
                 return false;
             }
             var passwordemaillienhe = document.getElementsByName("ThongTinCongTy_PasswordEmailLienHe").item(0);
             if (passwordemaillienhe.value == "") {
                 alert("Please input PasswordEmailLienHe");
                 return false;
             }
             var xacnhanpasswordemaillienhe = document.getElementsByName("ThongTinCongTy_XacNhanPasswordEmailLienHe").item(0);
             if (xacnhanpasswordemaillienhe.value == "") {
                 alert("Please input XacNhanPasswordEmailLienHe");
                 return false;
             }
             if (passwordemaillienhe.value != xacnhanpasswordemaillienhe.value) {
                 alert("Mật khẩu và xác nhận mật khẩu không giống nhau");
                 return false;
             }
             return true;
         }
    </script>
	<div id="PartialDiv">
		<% Html.RenderPartial("Templates/TH_ListThongTinCongTy", Model); %>
	</div>
    <% if (Model.ThongTinCongTyModel.GetModel.LstObjModel.Count == 0)
       { %>
	    <% using (Html.BeginForm("InsertThongTinCongTy", "Admin", FormMethod.Post, new { onsubmit = "return ValidateThongTinCongTy();" }))
        { %>
		    <div style="padding-top: 40px">
			    <span style="font-size:18px; font-weight:bold;">Add New ThongTinCongTy</span>
			    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="AdminPageText">
				    <tbody>
					    <tr>
						    <td>
							    <div align="left" style="padding-top:15px;">
								    <font class="normal8">EmailLienHe: </font>
							    </div>
						    </td>
						    <td height="20">
							    <div align="left" style="padding-top:15px">
								    <%= Html.TextBox("ThongTinCongTy_EmailLienHe", "", new { @style = "width: 290px;" })%>
							    </div>
						    </td>
					    </tr>
					    <tr>
						    <td>
							    <div align="left" style="padding-top:15px">
								    <font class="normal8">PasswordEmailLienHe: </font>
							    </div>
						    </td>
						    <td height="20">
							    <div align="left" style="padding-top:15px">
								    <%= Html.Password("ThongTinCongTy_PasswordEmailLienHe", "", new { @style = "width: 290px;" })%>
							    </div>
						    </td>
					    </tr>
                         <tr>
						    <td>
							    <div align="left" style="padding-top:15px">
								    <font class="normal8">Xac nhan PasswordEmailLienHe: </font>
							    </div>
						    </td>
						    <td height="20">
							    <div align="left" style="padding-top:15px">
								    <%= Html.Password("ThongTinCongTy_XacNhanPasswordEmailLienHe", "", new { @style = "width: 290px;" })%>
							    </div>
						    </td>
					    </tr>
					    <tr>
						    <td height="20" style="width: 130px">
						    </td>
						    <td height="20">
							    <div align="left">
								    <br/>
								    <p>
									    <input type="submit" value="Add New" />
								    </p>
							    </div>
						    </td>
					    </tr>
				    </tbody>
			    </table>
		    </div>
	    <% } %>
    <% } %>
</asp:Content>
